<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    var human = {
        say:function(v){
            alert('人在说：'+v)
        }
    };
    var dog = {
        say:function(v){
            alert('狗在说：'+v)
        }
    }

    function hello(v,v2){
       this.say(v);
    }
// hello();//window.say
    var type = prompt('请输入你是人还是狗');{
        if (type == '狗'){
            hello.apply(dog,["哪里有骨头",'aa']);
        } else {
            hello.apply(human,["哪里有工作",'bb']);
        }
    }

</script>
</body>
</html>